var webpack = require('webpack');
var path = require('path');
var definePlugin = new webpack.DefinePlugin({
    __DEV__: JSON.stringify(JSON.parse(process.env.DEV || 'false')),
});

module.exports = {
    entry: ["./js/app.js"],
    externals: {
        'angular': 'angular'
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: "bundle.js",
        publicPath: '/dist/'
    },
    module: {
        loaders: [
            {
                test: /\.css$/,
                loader: "style!css" ,
                exclude: /node_modules/
            },
            {
                loader: 'babel-loader',
                exclude: /node_modules/,
                test: /\.js?$/,
                query: {
                    presets: ['es2015'],
                },
            },
            {
                test: /\.less$/,
                exclude: /node_modules/,
                loader: "style!css!less?strictMath&noIeCompat"
            }
        ]
    },
    plugins: [definePlugin],
    resolve: {
        root: [path.resolve(__dirname, 'js')]
    }
};
